﻿<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ page import="ssi.beans.User"%>
<%@page language="Java" contentType="text/html; UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%
	User user;
	String username;
	String status = null;
	if (session.getAttribute("user") != null) {
		user = (User) session.getAttribute("user");
		username = user.getName();
		status = user.getTypeOfUser().toString();
	} else {
		status = "Niezalogowany";
		username = "Nieznany";
	}
%>

<title>X - SCHRONISKO</title>
<link rel="shortcut icon" href="images/ikona.ico" type="image/x-icon" />
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/nivo-slider.css" type="text/css"
	media="screen" />

<script language="javascript" type="text/javascript">
	function clearText(field) {
		if (field.defaultValue == field.value)
			field.value = '';
		else if (field.value == '')
			field.value = field.defaultValue;
	}
</script>

<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />

<script type="text/javascript" src="js/checkForm.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js"></script>
<script type="text/javascript">
	ddsmoothmenu.init({
		mainmenuid : "templatemo_menu",
		orientation : 'h',
		classname : 'ddsmoothmenu',
		contentsource : "markup"
	});
</script>


<script type="text/javascript" src="js/moreLess.js"></script>

</head>
<body>

	<div id="templatemo_wrapper">
		<div id="templatemo_header">
			<div id="site_title">
				<h1>X-SCHRONISKO</h1>
				<br>
				<html:form action="search">
					<input type="text" value="Szukaj" name="search" id="search"
						title="keyword" onfocus="clearText(this)" onblur="clearText(this)"
						class="txt_field" /><br>
						<select id="type" name="type">
			<option	value="0">Wybierz...</option>
			<% if(status.equalsIgnoreCase("ADMIN") || status.equals("WORKER") || status.equals("BOSS")){ %>
				<option>Użytkownik</option>
			<%} %>
			<option>Zwierzę</option>
			<option>Ogłoszenie</option>
			</select>
						 <input type="submit" name="szukaj" value=""
						alt="Szukaj" id="searchbutton" title="Szukaj" class="sub_btn" />

				</html:form>

			</div>
			<%
				if (session.getAttribute("user") == null) {
			%>
			<div id="templatemo_search">
				<div id="change">
				<a class='black' href="index.jsp?page=register">Rejestracja</a>
				<a class='black' href="#" onclick="remind()">Zapomniałem hasła</a>
				<html:form action="login">

					<input type="text" value="email" onfocus="clearText(this)" onblur="clearText(this)" name="userName" id="userName"
						class="txt_field" />

					<input type="password" onfocus="clearText(this)" onblur="clearText(this)" value="haslo" id="password" name="password"
						class="txt_field" />

					<input type="submit" value="" alt="Search" id="searchbutton"
						title="Loguj" class="sub_btn" name="Search" />
				
				
					<font color="red"><html:errors property="info" /></font>


				</html:form>
					
				</div>


			</div>
			<%
				} else {
			%>
			<div id="templatemo_search2">

				<html:form action="logout">
					<h3>
						Witaj
						<%=username%></h3>
					<input class='submit' type="submit" value="Wyloguj!" />
				</html:form>
			</div>
			<%
				}
			%>
			<div class="cleaner"></div>
		</div>